package jdk8;

import java.util.function.Function;
//类静态方法引用。
public class TestClassMethodRef01 {
    public static void main(String[] args) {
        Function<String,Integer> f1=new Function<String, Integer>() {
            @Override
            public Integer apply(String t) {
                return Integer.parseInt(t);
            }
        };
        Integer result = f1.apply("100");
        System.out.println("result = " + result);

        //lambda应用方式
        Function<String,Integer> f2=(t)->Integer.parseInt(t);
        System.out.println("f2 = " + f2.apply("200"));
        //3.类方法引用应用方式"类名::方法名"
        Function<String,Integer> f3=Integer::parseInt;
        System.out.println("f3=" + f3.apply("300"));
    }
}
